#pragma once
#include "TextSpan.hpp"

#include <cstddef>
#include <string>

class SourceText;

class TextLine {
public:
  SourceText *Text;
  size_t Start;
  size_t Length;
  size_t End;
  size_t LengthIncludingLineBreak;
  TextSpan Span;
  TextSpan SpanIncludingLineBreak;

public:
  TextLine(SourceText *text, size_t start, size_t length,
           size_t lengthIncludingLineBreak)
      : Start(start), Length(length), End(start + length),
        LengthIncludingLineBreak(lengthIncludingLineBreak), Span(start, length),
        SpanIncludingLineBreak(start, lengthIncludingLineBreak) {}
  std::string ToString();
};